package cn.cloud.butler.webapi.service;

import cn.cloud.butler.webapi.domain.ActionUrlEntity;
import cn.cloud.butler.webapi.repository.ActionUrlRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class ActionUrlService {
    private final ActionUrlRepository actionUrlRepository;

    @Autowired
    public ActionUrlService(ActionUrlRepository actionUrlRepository) {
        this.actionUrlRepository = actionUrlRepository;
    }

    @Cacheable(value = "user-key")
    public ActionUrlEntity findByUrl(String url){
        return actionUrlRepository.findByUrl(url);
    }
}
